//发送验证码
    $(function(){
  $('#sendCode').on("click", function(){
            $.ajax({
            type: 'GET',
            url: '/sendMessage',
            dataType:  'json',
            data:  {"phoneNumber": $('#phoneNumber').val()},
            success: function (res) {
                if (res==="success"){
                    alert("验证码发送成功")
                }
                else {
                    alert("验证码发送失败")
                }
            },

            error: function (errMsg) {


            }
        });
		})



  //提交
        $("#sub-btn").on("click", function(){
            repeatedPassword = $.trim($('#RepeatedPasswordR').val());
            password = $.trim($('#passwordR').val());
            phoneNumber = $.trim($('#phoneNumber').val());
            validationCode = $.trim($('#validationCode').val());
            if (password===repeatedPassword){
                $.ajax({
                url:  "/editPassword",
                type: "GET",
                dataType: 'text',
                data: {
                        "password":password,
                        "number":phoneNumber,
                        "verifyCode":validationCode
                },
                success: function (data){
                    if(data === 'success'){
                        alert("修改成功");

                        return ;
                    }else if(data ==="验证码错误"){
                        alert("验证码错误");
                        return ;
                    }else {
                        alert("修改失败");
                    }
                },
                error:function (XMLHttpRequest, textStatus, errorThrown){
                    alert(XMLHttpRequest.readyState + XMLHttpRequest.status + XMLHttpRequest.responseText)
                }
            });
            }
            else {
                alert("密码不相同")
            }

        })
     })